package com.spzx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spzx.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌Service业务层处理
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper,Brand> implements IBrandService {

    @Autowired
    private BrandMapper brandMapper;

    /**
     * 添加品牌
     * @param brand
     */
    @Override
    public void add(Brand brand) {
        brandMapper.insert(brand);
    }

    /**
     * 修改品牌
     * @param brand
     */
    @Override
    public void update(Brand brand) {
        brandMapper.updateById(brand);
    }

    @Override
    public Brand getInfo(Long id) {
        return brandMapper.selectById(id);
    }


    @Override
    public void deleteBrandByIds(Long[] ids) {
        brandMapper.deleteBrandByIds(ids);
    }

    @Override
    public IPage<Brand> listPage(Page<Brand> pageParam, Brand brand) {
        return brandMapper.listPage(brand);
    }
}
